﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FieldHost;

namespace Field {
	public class Admin {

		#region Constructor

		public Admin() {
			FGPrice = new MetaField<int> {
				MinValue = 0
			};

			AllCustBonus = new MetaField<int> {
				MinValue = -10,
				MaxValue = 10,
				IsBoundCheckActive = true
			};

			NoDebt = new MetaField<bool> {
				Value = false
			};

			DebtLimit = new MetaField<double> {
				MinValue = 0,
				MaxValue = 100000,
				IsBoundCheckActive = true
			};
		}

		#endregion

		public MetaField<int> FGPrice {
			get;
			private set;
		}

		//TODO: this
		//Customer satisfaction bonus
		//cSatBonus(LOW_REG To HIGH_REG, LOW_INDCUST To HIGH_INDCUST) As Integer   
		
		public MetaField<int> AllCustBonus {
			get;
			private set;
		}

		//can be a bool
		/// <summary>
		/// Use to determine if we allow debt related decisions. Do we shut a team off from getting any more debt?
		/// </summary>
		public MetaField<bool> NoDebt {
			get;
			private set;
		}

		/// <summary>
		/// Debt Equity Limit. Ratio between debt and equity.
		/// </summary>
		public MetaField<double> DebtLimit {
			get;
			private set;
		}
		
		private readonly List<MetaField<int>> _fire = new List<MetaField<int>>();

		/// <summary>
		/// Reps who quitted 
		/// </summary>
		public List<MetaField<int>> Fire {
			get {
				return _fire;
			}
		}
				
		private readonly SpecializedCollection<int, MetaField<int>> _salary = new SpecializedCollection<int, MetaField<int>>();

		public SpecializedCollection<int, MetaField<int>> Salary {
			get{
				return _salary;
			}
		}

		/// <summary>
		/// Sales reps salary
		/// </summary>
		public List<MetaField<int>> Salary {
			get {
				return _salary;
			}
		}

		private readonly List<MetaField<int>> _extraReps = new List<MetaField<int>>();

		//TODO: remove - it is not in use across the app.
		public List<MetaField<int>> ExtraReps {
			get {
				return _extraReps;
			}
		}

		/// <summary>
		/// Market research savings.
		/// </summary>
		public MetaField<int> MktResSavings {
			get;
			set;
		}

		/// <summary>
		/// 
		/// </summary>
		public MetaField<int> SalesOfficeSavings {
			get;
			set;
		}

		/// <summary>
		/// 
		/// </summary>
		public MetaField<int> LtIssue {
			get;
			set;
		}
		
		/// <summary>
		/// Interest rate for long term loans
		/// </summary>
		public MetaField<int> LtRate {
			get;
			set;
		}

		/// <summary>
		/// 
		/// </summary>
		public MetaField<int> IssueDividends {
			get;
			set;
		}

		public MetaField<int> IssueStockShares {
			get;
			set;
		}

		public MetaField<int> IssueStockPrice {
			get;
			set;
		}

		public MetaField<int> BuyBackStoreShares {
			get;
			set;
		}

		public MetaField<int> BuyBackStorePrice {
			get;
			set;
		}

		/// <summary>
		/// Increase production schedule
		/// </summary>
		public MetaField<int> IncSchedule {
			get;
			set;
		}

		/// <summary>
		/// Increase production capacity
		/// </summary>
		public MetaField<int> IncCapacity {
			get;
			set;
		}

		/// <summary>
		/// 
		/// </summary>
		public MetaField<int> ProfitShare {
			get;
			set;
		}

		/// <summary>
		/// Unit manufactoring cost Delta
		/// </summary>
		public MetaField<int> IncUmc {
			get;
			set;
		}

		/// <summary>
		/// Product enhancement delta
		/// </summary>
		public MetaField<int> IncProdEnhance {
			get;
			set;
		}

		/// <summary>
		/// Rejection rate delta
		/// </summary>
		public MetaField<int> IncRejRate {
			get;
			set;
		}

		/// <summary>
		/// Sales reps delta (hire/fire)
		/// </summary>
		public MetaField<int> IncSalesReps {
			get;
			set;
		}

		/// <summary>
		/// 
		/// </summary>
		public MetaField<int> AdminMiscCashInFlowOutFlow {
			get;
			set;
		}

		/// <summary>
		/// 
		/// </summary>
		public MetaField<int> AdminMiscRevenueExpense {
			get;
			set;
		}

		public MetaField<int> Bankrupt {
			get;
			set;
		}

		public MetaField<int> BankruptInventoryBuyBack {
			get;
			set;
		}
	}
}
